

<script setup>
import{ref}from 'vue'
    const count=ref(0);
    const fun=()=>{
      count.value++;
    }
    const fun1=(a)=>{
      count.value+=a

    }
</script>

<template>
<div>
  {{ count }}
  <!-- 这是不简写 -->
  <button v-on:click="count++">+1</button>
</div>
<div>
  <button v-on:click="fun">函数+1</button>
</div>
<div>
  <button v-on:click="fun1(3)">函数每次加等于3</button>
</div>
<!-- 简写 -->
 <div>
  <button @click="count++">+1</button>
  <button @click="fun">函数+1</button>
  <button @click="fun1(3)">函数每次加等于3</button>
 </div>
</template>



<style scoped>

</style>
